<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>中国禁毒数据大屏</title>
    <link rel="stylesheet" th:href="@{css/index.css}"/>
</head>

<body>
<header>
    <h1> 中国禁毒数据大屏</h1>
    <div class="showTime">当前时间：2020年3月17-0时54分14秒</div>
    <script>
        var t = null;
        t = setTimeout(time, 1000); //開始运行
        function time() {
            clearTimeout(t); //清除定时器
            dt = new Date();
            var y = dt.getFullYear();
            var mt = dt.getMonth() + 1;
            var day = dt.getDate();
            var h = dt.getHours(); //获取时
            var m = dt.getMinutes(); //获取分
            var s = dt.getSeconds(); //获取秒
            document.querySelector(".showTime").innerHTML =
                "当前时间：" +
                y +
                "年" +
                mt +
                "月" +
                day +
                "-" +
                h +
                "时" +
                m +
                "分" +
                s +
                "秒";
            t = setTimeout(time, 1000); //设定定时器，循环运行
        }
    </script>
</header>
<section class="mainbox">
    <div class="column">
        <div class="panel bar">
            <h2>
                近五年累计登记吸毒人数变化图（单位：万名）
            </h2>
            <div class="chart"></div>
            <div class="panel-footer"></div>
        </div>
        <div class="panel line">
            <h2>近五年缴获毒品数据统计（单位：吨）</h2>
            <div class="chart"></div>
            <div class="panel-footer"></div>
        </div>
        <div class="panel pie">
            <h2>吸毒人员年龄结构</h2>
            <div class="chart"></div>
            <div class="panel-footer"></div>
        </div>
    </div>
    <div class="column">
        <div class="no">
            <div class="no-hd">
                <ul>
                    <li>214.8 万</li>
                    <!-- <li>2147151</li> -->
                </ul>
            </div>
            <div class="no-bd">
                <ul>
                    <li>现有吸毒人员</li>
                    <!-- <li>市场供应人数</li> -->
                </ul>
            </div>
        </div>
        <div class="divbiaoti">
            <h2 class="bth2">境外毒品主要贩运路线</h2>
        </div>
        <div class="map">
            <div class="chart"></div>
            <div class="map1"></div>
            <div class="map2"></div>
            <div class="map3"></div>
        </div>
<!--        <div class="shenmin">-->
<!--            <h3 class="bth2">所有数据收集于中国禁毒网，仅供参考</h3>-->
<!--        </div>-->
    </div>
    <div class="column">
        <div class="panel bar1">
            <h2>毒品类别（单位：万名）</h2>
            <div class="chart"></div>
            <div class="panel-footer"></div>
        </div>
        <div class="panel line1">
            <h2>网站浏览量-数据大屏浏览量</h2>
            <div class="chart"></div>
            <div class="panel-footer"></div>
        </div>
        <div class="panel pie1">
            <h2>累计登记吸毒人员地区分布</h2>
            <div class="chart"></div>
            <div class="panel-footer"></div>
        </div>
    </div>

</section>
<!--    <script src="../../static/js/flexible.js"></script>-->
<!--    <script src="../../static/js/jquery.js"></script>-->
<!--    <script src="../../static/js/echarts.min.js"></script>-->
<!--    <script src="../../static/js/index.js"></script>-->
<!--    <script src="../../static/js/china.js"></script>-->
<!--    <script src="../../static/js/myMap.js"></script>-->

<script th:src="@{js/flexible.js}"></script>
<script th:src="@{js/jquery.js}"></script>
<script th:src="@{js/echarts.min.js}"></script>
<script th:src="@{js/index.js}"></script>
<script th:src="@{js/china.js}"></script>
<script th:src="@{js/myMap.js}"></script>
<script th:inline="javascript">
    var message = [[${logindex}]];
    var logksh = [[${logksh}]];
    var namelist = [[${namelist}]];
    console.log(message);
    console.log(logksh);
    console.log(namelist);
    (function () {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.querySelector(".line1 .chart"));

        option = {
            tooltip: {
                trigger: "axis",
                axisPointer: {
                    lineStyle: {
                        color: "#dddc6b"
                    }
                }
            },
            legend: {
                top: "0%",
                textStyle: {
                    color: "rgba(255,255,255,.5)",
                    fontSize: "12"
                }
            },
            grid: {
                left: "10",
                top: "30",
                right: "10",
                bottom: "10",
                containLabel: true
            },

            xAxis: [
                {
                    type: "category",
                    boundaryGap: false,
                    axisLabel: {
                        textStyle: {
                            color: "rgba(255,255,255,.6)",
                            fontSize: 12
                        }
                    },
                    axisLine: {
                        lineStyle: {
                            color: "rgba(255,255,255,.2)"
                        }
                    },
                    //月份
                    data: namelist
                },
                {
                    axisPointer: {show: false},
                    axisLine: {show: false},
                    position: "bottom",
                    offset: 20
                }
            ],

            yAxis: [
                {
                    type: "value",
                    axisTick: {show: false},
                    axisLine: {
                        lineStyle: {
                            color: "rgba(255,255,255,.1)"
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            color: "rgba(255,255,255,.6)",
                            fontSize: 12
                        }
                    },

                    splitLine: {
                        lineStyle: {
                            color: "rgba(255,255,255,.1)"
                        }
                    }
                }
            ],
            series: [
                {
                    name: "网站浏览量",
                    type: "line",
                    smooth: true,
                    symbol: "circle",
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        normal: {
                            color: "#0184d5",
                            width: 2
                        }
                    },
                    areaStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                                0,
                                0,
                                0,
                                1,
                                [
                                    {
                                        offset: 0,
                                        color: "rgba(1, 132, 213, 0.4)"
                                    },
                                    {
                                        offset: 0.8,
                                        color: "rgba(1, 132, 213, 0.1)"
                                    }
                                ],
                                false
                            ),
                            shadowColor: "rgba(0, 0, 0, 0.1)"
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: "#0184d5",
                            borderColor: "rgba(221, 220, 107, .1)",
                            borderWidth: 12
                        }
                    },
                    //网站浏览量
                    data: message
                },
                {
                    name: "数据大屏浏览量",
                    type: "line",
                    smooth: true,
                    symbol: "circle",
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        normal: {
                            color: "#00d887",
                            width: 2
                        }
                    },
                    areaStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                                0,
                                0,
                                0,
                                1,
                                [
                                    {
                                        offset: 0,
                                        color: "rgba(0, 216, 135, 0.4)"
                                    },
                                    {
                                        offset: 0.8,
                                        color: "rgba(0, 216, 135, 0.1)"
                                    }
                                ],
                                false
                            ),
                            shadowColor: "rgba(0, 0, 0, 0.1)"
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: "#00d887",
                            borderColor: "rgba(221, 220, 107, .1)",
                            borderWidth: 12
                        }
                    },
                    //数据大屏浏览量
                    data: logksh
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    })();

</script>
</body>
</html>
